package com.example.shop.service.impl;

import com.example.shop.entity.Logistice;
import com.example.shop.dao.LogisticeMapper;
import com.example.shop.service.LogisticeService;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;

import java.util.List;

/**
 * (Logistice)表服务实现类
 *
 * @author makejava
 * @since 2025-03-26 09:25:40
 */
@Service("logisticeService")
public class LogisticeServiceImpl implements LogisticeService {
    @Resource
    private LogisticeMapper logisticeMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param logisticeid 主键
     * @return 实例对象
     */
    @Override
    public Logistice queryById(Integer logisticeid) {
        return this.logisticeMapper.queryById(logisticeid);
    }


    /**
     * 新增数据
     *
     * @param logistice 实例对象
     * @return 实例对象
     */
    @Override
    public Logistice insert(Logistice logistice) {
        this.logisticeMapper.insert(logistice);
        return logistice;
    }

    /**
     * 修改数据
     *
     * @param logistice 实例对象
     * @return 实例对象
     */
    @Override
    public Logistice update(Logistice logistice) {
        this.logisticeMapper.update(logistice);
        return this.queryById(logistice.getLogisticeid());
    }

    /**
     * 通过主键删除数据
     *
     * @param logisticeid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer logisticeid) {
        return this.logisticeMapper.deleteById(logisticeid) > 0;
    }

    @Override
    public List<Logistice> queryAll() {
        return null;
    }
}
